package com.cordershy.pojo;

import org.apache.ibatis.type.Alias;
import org.springframework.stereotype.Component;

import java.io.Serializable;

@Component
@Alias(value = "goal")
public class goal implements Comparable<goal>,Serializable {
    private int goalid;
    private String goaltime;
    private String goalcontent;
    private String goaloath;
    private String goalfinish;
    private String username;

    public goal() {
    }

    public goal(int goalid, String goaltime, String goalcontent, String goaloath, String goalfinish, String username) {
        this.goalid = goalid;
        this.goaltime = goaltime;
        this.goalcontent = goalcontent;
        this.goaloath = goaloath;
        this.goalfinish = goalfinish;
        this.username = username;
    }

    public void setGoalid(int goalid) {
        this.goalid = goalid;
    }

    public void setGoaltime(String goaltime) {
        this.goaltime = goaltime;
    }

    public void setGoalcontent(String goalcontent) {
        this.goalcontent = goalcontent;
    }

    public void setGoaloath(String goaloath) {
        this.goaloath = goaloath;
    }

    public void setGoalfinish(String goalfinish) {
        this.goalfinish = goalfinish;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public int getGoalid() {
        return goalid;
    }

    public String getGoaltime() {
        return goaltime;
    }

    public String getGoalcontent() {
        return goalcontent;
    }

    public String getGoaloath() {
        return goaloath;
    }

    public String getGoalfinish() {
        return goalfinish;
    }

    public String getUsername() {
        return username;
    }

    @Override
    public String toString() {
        return "goal{" +
                "goalid=" + goalid +
                ", goaltime='" + goaltime + '\'' +
                ", goalcontent='" + goalcontent + '\'' +
                ", goaloath='" + goaloath + '\'' +
                ", goalfinish='" + goalfinish + '\'' +
                ", username='" + username + '\'' +
                '}';
    }

    @Override
    public int compareTo(goal o) {
        return o.getGoalid()-this.getGoalid();
    }
}
